/*global Vue*/
import Router from 'vue-router'
import Home from '@/pages/Home'
import Vip from '@/pages/Vip'
import Shopping from '@/pages/Shopping'
import Search from '@/pages/Search' 

import News from '@/components/News/News'
import ImgShare from '@/components/ImgShare/ImgShare'
import Goods from '@/components/Goods/Goods'
import Messages from '@/components/Messages/Messages'
import Video from '@/components/Video/Video'
import Contact from '@/components/Contact/Contact'

import NewsItem from '@/components/NewsItem/NewsItem'
import ImgShareItem from '@/components/ImgShareItem/ImgShareItem'
import GoodsItem from '@/components/GoodsItem/GoodsItem'
import ProductDetails from '@/components/ProductDetails/ProductDetails'
//todo 子路由路径不能有/
export default new Router ({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home,
      meta:{
        requiresAuth:true,
        index:1
      }
    },
    {
      path: '/vip',
      component: Vip,
      meta:{
        requiresAuth:true
      }
    },
    {
      path: '/shopping',
      component: Shopping,
      meta:{
        requiresAuth:true
      }
    },
    {
      path: '/search',
      component: Search,
      meta:{
        requiresAuth:true
      }
    },
    {
      path: '/news',
      component: News,
      meta:{
        index:2
      }
    },
    {
      path: '/imgShare',
      component: ImgShare,
    },
    {
      path: '/goods',
      component: Goods,
    },
    {
      path: '/messages',
      component: Messages,
    },
    {
      path: '/video',
      component: Video,
    },
    {
      path: '/contact',
      component: Contact,
    },

    {
      path:'/news/:id',
      component:NewsItem
    },
    {
      path:'/imgShareItem/:id',
      component:ImgShareItem
    },
    {
      path:'/goods/:id',
      component:GoodsItem
    },
    {
      path:'/goods/:id/details',
      component:ProductDetails
    },
  ]
})
